<?php
/**
* エラーチェッククラス
**/
require_once( '../system/Class_M_DAO.php' );
class Class_M_AREA extends Class_M_DAO {
	//protected properties begin
	/**
	 *
	 * テーブル名
	 *
	 * @access    protected
	 * @var       string
	 *
	 */
	protected $_table  = "M_AREA";
	
	/**
	 *
	 * 主キー名
	 *
	 * @access    protected
	 * @var       string
	 *
	 */
	protected $_pkey   = "area_cd";
	
	/**
	 *
	 * ソート順
	 *
	 * @access    protected
	 * @var       string
	 *
	 */
	 protected $_order = "area_cd";
	 
	 protected $_cols  = array(
		"area_cd"        => array(AOKI_VARTYPE_STR),
		"area_name"      => array(AOKI_VARTYPE_STR)
	 );
	
	 protected $_checks  = array(
		"area_cd"         => array( "EXIST" ),
		"area_name"       => array( "EXIST" )
	 );
	 
	 //maxlength 
	 protected $_maxlens  = array(
		"area_cd "    =>  5 ,
		"area_name "      => 50 
	 );
	
	 public function search($where ,&$page = NULL ){	
	 	
		$sql = "SELECT a.*,(select  user_name FROM M_LOGIN where id  = a.u_user) as m_user_name from {$this->_table}  a ";
		return  parent::search($where ,$page ,$sql);
	}
	
}

?>